/*
 * SettingChangedEvent.h
 *
 *  Created on: 01.05.2009
 *      Author: h3llfire
 */

#ifndef SETTINGCHANGEDEVENT_H_
#define SETTINGCHANGEDEVENT_H_

#include <wx/event.h>
#include "../database/DBModule.h"

namespace Impp {

class SettingChangedEvent : public wxNotifyEvent{
private:
	DBModule module;
	wxString settingName;

public:
	SettingChangedEvent(const DBModule & module, const wxString & settingName, wxEventType eventType = wxEVT_NULL, int id = 0);
	virtual ~SettingChangedEvent();

	virtual wxEvent* Clone()const;

	DBModule& getModule();
	wxString getSettingName();
};

typedef void(wxEvtHandler::*SettingChangedEventFunction)(SettingChangedEvent&);

BEGIN_DECLARE_EVENT_TYPES()
  DECLARE_EVENT_TYPE(EVT_SETTING_CHANGED, -1)
END_DECLARE_EVENT_TYPES()

#define EVT_SETTING_CHANGED_MACRO(id, fn) DECLARE_EVENT_TABLE_ENTRY(               \
		EVT_SETTING_CHANGED, id, -1, (wxObjectEventFunction)               \
        (wxEventFunction)(SettingChangedEventFunction) & fn,                             \
        (wxObject*) NULL),

#define SettingChangedEventHandler(func)                                                 \
        (wxObjectEventFunction)                                                \
        (wxEventFunction)wxStaticCastEvent(SettingChangedEventFunction, &func)


}

#endif /* SETTINGCHANGEDEVENT_H_ */
